<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script type="text/javascript">
(function(){
	$("#channelMode_asp").attr("value",'${requestScope.simpleBean.channelMode}');
})();
</script>
<form id="pagerForm" method="post" action="<%=basePath%>channel_findchannelAddSPPrice.action"> <!-- 此action指定的是排序、分页所提交的action -->
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum" value="${requestScope.pageNum}" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
	<!-- 存放查询条件 -->
	<input type="hidden" name="simpleBean.channelName" value="${requestScope.simpleBean.channelName}" />
	<input type="hidden" name="simpleBean.channelAliAs" value="${requestScope.simpleBean.channelAliAs}" />
	<input type="hidden" name="simpleBean.channelMode" value="${requestScope.simpleBean.channelMode}" />
</form>


<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="<%=basePath%>channel_findchannelAddSPPrice.action?numPerPage=10&pageNum=1&orderField=P_CHANNEL_NUMBER&orderDirection=asc" method="post">
	<div class="searchBar">
				<div class="pageFormContent1">
					<p>
					<label width="50">渠道名称：</label>
					<input type="text" name="simpleBean.channelName" value="${requestScope.simpleBean.channelName}" />
					</p>
					<p>
					<label>渠道别名：</label>
					<input type="text" name="simpleBean.channelAliAs" value="${requestScope.simpleBean.channelAliAs}" />
					</p>
					<p>
					<label>物流模式：</label>
					<select id="channelMode_asp" name="simpleBean.channelMode" class=" combox">
					<option value="">全部</option>
					<option value="PT">国际小包</option>
					<option value="IE">国际快递</option>
					</select>
					</p>
				</div>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">&nbsp;&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;&nbsp;</button></div></div></li>
			</ul>
		</div>
	</div> 
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<%=basePath%>specialPrice_findSPartitionsForChannel.action?channelNumber={sid_user}" target="navTab" title="为渠道选择起始分区添加特殊客户报价" rel="importPrice_spPrice"><span>为渠道选择起始分区添加特殊客户报价</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="163">
		<thead>
			<tr>
				<th width="120" orderField="P_CHANNEL_NAME" class="<%=request.getParameter("orderDirection") %>">渠道名称</th>
				<th width="150" orderField="P_CHANNEL_ALIAS" class="<%=request.getParameter("orderDirection") %>">渠道别名</th>
				<th width="100" orderField="ch.P_CLASS_NUMBER" class="<%=request.getParameter("orderDirection") %>">渠道类别</th>
				<th width="150" orderField="P_CHANNEL_MODE" class="<%=request.getParameter("orderDirection") %>">物流模式</th>
				<th width="80" orderField="P_CHANNEL_CLASS" class="<%=request.getParameter("orderDirection") %>">适用类别</th>
				<th width="80" orderField="P_CHANNEL_S_PARTITION" class="<%=request.getParameter("orderDirection") %>">起始分区数</th>
				<th width="80" orderField="P_CHANNEL_E_PARTITION" class="<%=request.getParameter("orderDirection") %>">目的分区数</th>
				<th width="50" orderField="P_CHANNEL_STATUS" class="${requestScope.orderDirection }">状态</th>
			</tr>
		</thead>
		<tbody id="channelTbody_asp">
			<c:forEach items="${requestScope.channelList}" var="channel" varStatus="varStatus">
			<tr target="sid_user" rel="${channel.channelNumber}">
				<td>${channel.channelName}</td>
				<td>${channel.channelAliAs}</td>
				<td>${channel.typeName}</td>
				<td>${channel.channelMode}</td>
				<td>${channel.channelClass}</td>
				<td>${channel.startCount}</td>
				<td>${channel.endCount}</td>
				<c:if test="${channel.status eq 'NE'}">
					<td>启用</td>
				</c:if>
				<c:if test="${channel.status eq 'CL'}">
					<td>停用</td>
				</c:if>
			</tr>
		</c:forEach>
		
		</tbody>
	</table>
	<div class="panelBar" >
		<div class="pages">
			<span>显示</span>
			<select id="countSelect" class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"  >
				<option value="10">10</option>
				<option value="50">50</option>	
				<option value="100">100</option>
			</select>
			<span>条，共${requestScope.totalRecords}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="${requestScope.totalRecords}" numPerPage="${requestScope.pageSize}" pageNumShown="${requestScope.totalPages}" currentPage="${requestScope.pageNum }"></div>

	</div>
</div>
<script type="text/javascript">
	(function () {
		var a = document.getElementById("countSelect");
		
		switch(${requestScope.numPerPage}){
			case 10:
				a.options.selectedIndex = 0;
				break;
			case 50:
				a.options.selectedIndex = 1;
				break;
			case 100:
				a.options.selectedIndex = 2;
				break;
		}
		var len = $("#channelTbody_asp tr").length;
		for(var i=0;i<len;i++){
			switch($("#channelTbody_asp tr:eq("+i+") td:eq(3)").html()){
				case "PT":
					$("#channelTbody_asp tr:eq("+i+") td:eq(3)").html("国际小包");
					break;
				case "IE":
					$("#channelTbody_asp tr:eq("+i+") td:eq(3)").html("国际快递");
					break;
				case "DC":
					$("#channelTbody_asp tr:eq("+i+") td:eq(3)").html("国内快递");
					break;
				case "AT":
					$("#channelTbody_asp tr:eq("+i+") td:eq(3)").html("空运");
					break;
				case "SG":
					$("#channelTbody_asp tr:eq("+i+") td:eq(3)").html("海运");
					break;
				case "WG":
					$("#channelTbody_asp tr:eq("+i+") td:eq(3)").html("仓储");
					break;
			}
			switch($("#channelTbody_asp tr:eq("+i+") td:eq(4)").html()){
				case '1':
		 			$("#channelTbody_asp tr:eq("+i+") td:eq(4)").html("出货");
		 		break;
		 		case '2':
		 			$("#channelTbody_asp tr:eq("+i+") td:eq(4)").html("收货");
		 		break;
		 		default:
		 			$("#channelTbody_asp tr:eq("+i+") td:eq(4)").html("出/收货");
		 		break;
		 	}
		}
	})();
</script>
